// 公共方法
import store from '@/store';
import * as utils from '@/utils/index';
export default {
  // 改变标题
  setPageTitle(title) {
    utils.throttle(store.dispatch, ['setPageTitle', title], this, 100);
  },
  // 改变是否显示 0 为false 1为true
  setPageTitleShow(v) {
    store.dispatch('setPageTitleShow', v + '');
  },

  // 是否返回键状态  0 为false 1为true
  setIsBack(v) {
    store.dispatch('setIsBack', v + '');
  },

  // 0 为false 1为true
  setIsTabbar(v) {
    store.dispatch('setIsTabbar', v + '');
  },

  getIsTabbar() {
    return store.getters.isTabbar === '1';
  },
  setTopBarHeight(v) {
    store.dispatch('setTopBarHeight', v);
  },

  getTopBarHeight() {
    const h = store.getters.topBarHeight;
    return utils.isNaNStr(h);
  },
  setBottomBarHeight(v) {
    store.dispatch('setBottomBarHeight', v);
  },

  getBottomBarHeight() {
    const h = store.getters.bottomBarHeight;
    return utils.isNaNStr(h);
  }

};
